//
//  OrderDetailGoodInfoCell.m
//  PPDL
//
//  Created by 王洋 on 2019/8/2.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "OrderDetailGoodInfoCell.h"

@interface OrderDetailGoodInfoCell ()


@property (weak, nonatomic) IBOutlet UILabel *itemSupplyName;

@property (weak, nonatomic) IBOutlet UIImageView *itemMainImage;

@property (weak, nonatomic) IBOutlet UILabel *itemGoodName;
@property (weak, nonatomic) IBOutlet UILabel *itemFinalPrice;
@property (weak, nonatomic) IBOutlet UILabel *itemFreightPrice;

@property (weak, nonatomic) IBOutlet UILabel *itemGoodCount;

@property (weak, nonatomic) IBOutlet UILabel *itemTotalPrice;

@end

@implementation OrderDetailGoodInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.itemMainImage pp_clipCorners:UIRectCornerAllCorners radius:6];
}

- (void)fillCellWithModel:(OrderDetailGoodInfoModel *)model {
    
    self.itemSupplyName.text = [NSString stringWithFormat:@"%@",model.itemSupplyName.length?model.itemSupplyName:@"未获取到供应商名称"];
    self.itemGoodName.text = [NSString stringWithFormat:@"%@",model.itemGoodName];
    [self.itemMainImage sd_setImageWithURL:[NSURL URLWithString:model.itemMainImage] placeholderImage:[UIImage imageNamed:@"placeholder_rect"] options:SDWebImageRetryFailed];
    
    self.itemFinalPrice.text =[NSString stringWithFormat:@"¥ %@",[Utilities changeDoubleToString:model.itemFinalPrice]];
    
    self.itemTotalPrice.text = [NSString stringWithFormat:@"¥ %@",[Utilities changeDoubleToString:model.itemTotalPrice]];
    
    self.itemFreightPrice.text = [NSString stringWithFormat:@"邮费：¥ %@",[Utilities changeDoubleToString:model.itemFreightPrice]];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
